<!--
 * @FilePath     : /study_code/vue2.x/api/vue-config-keyCodes.html
 * @Description  : vue-config-keyCodes
 * @Date         : 2025-05-06 08:49:43
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-05-06 08:52:46
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="" />
  </head>
  <body>
    <div id="app">
      <p>验证：vue 生效</p>
      <button @click="btnHandle">点击</button>
      <p>验证：输入框输入</p>
      <input type="text" @keyup="f1method()" />
      <input type="text" @keyup.v="inputmethod" />
      <input type="text" @keyup.media-play-pause="inputmethod" />
    </div>

    <script src="/vue/dist/vue.min.js"></script>
    <script src="../common.js"></script>
    <script>
      Vue.config.productionTip = false // 阻止 Vue 在启动时生成生产提示
      Vue.config.productionTip = false // 阻止 Vue 在启动时生成生产提示

      Vue.config.keyCodes = {
        v: 86,
        f1: 112,
        // camelCase 不可用
        mediaPlayPause: 179,
        // 取而代之的是 kebab-case 且用双引号括起来
        'media-play-pause': 179,
        up: [38, 87],
      }

      var app = new Vue({
        el: '#app',
        data: function () {
          return {}
        },
        methods: {
          btnHandle() {
            console.log('btn')
          },
          f1method() {
            console.log('e - f1 - 112')
          },
          inputmethod(e) {
            console.log('vs')
          },
        },
      })
    </script>
  </body>
</html>
